package com.jason.item.controller.vo;


import com.jason.item.model.ItemModel;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.math.BigDecimal;

@Data
public class ItemVO {

    private Integer id;

    private String title;

    private String description;
    private BigDecimal price;

    //库存
    private Integer stock;

    //销量
    private Integer sales;
    // 图片
    private String imgUrl;

    public static ItemVO convertByItemModel(ItemModel itemModel){
        ItemVO itemVO = new ItemVO();
        BeanUtils.copyProperties(itemModel, itemVO);
        return itemVO;
    }
}
